using System;
using System.IO;
using System.Collections.Generic;
using System.Text;

namespace LumiSoft.Net.MIME
{
    /// <summary>
    /// Represents MIME entity multipart/... body. Defined in RFC 2045.
    /// </summary>
    public class MIME_MultipartBody : MIME_Body
    {
        private MIME_EntityCollection m_pParts = null;

        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Owner MIME entity.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>owner</b> is null.</exception>
        internal MIME_MultipartBody(MIME_Entity owner) : base(owner)
        {
            m_pParts = new MIME_EntityCollection();
        }

        
        #region override method ToStream

        /// <summary>
        /// Stores MIME entity body to the specified stream
        /// </summary>
        /// <param name="stream">Stream where to store body. Storing starts from stream current position.</param>
        public override void ToStream(Stream stream)
        {
        }

        #endregion


        /// <summary>
        /// Parses MIME entity body from the specified stream.
        /// </summary>
        /// <param name="stream">Stream from where to parse body.</param>
        /// <param name="owner">Specifies if body will be stream owner.</param>
        /// <returns>Returns true if this is last boundary in the message or int multpiart "body parts".</returns>
        internal override bool ParseFromStream(Stream stream,bool owner)
        {
            return true;
        }


        #region Properties Implementation

        /// <summary>
        /// Gets body parts collection.
        /// </summary>
        public MIME_EntityCollection BodyParts
        {
            get{ return m_pParts; }
        }

        #endregion

    }
}
